package org.pfc.porlapatilla.repositories;

import java.util.List;

import org.pfc.porlapatilla.model.Product;
import org.springframework.data.mongodb.core.geo.Distance;
import org.springframework.data.mongodb.core.geo.Point;

/**
 * This interface provides additional methods to ProductRepository
 * 
 * @author jorgepolobermudez
 * 
 */
public interface IAdvancedRepository {

    /**
     * Find a products list in a subcategory list.
     * 
     * @param subcategories
     *            The subcategory list.
     * @return The found products list.
     */
    List<Product> findBySubcategoryIn(List<String> subcategories);

    /**
     * Find a products list in a subcategory list.
     * 
     * @param subcategories
     *            The subcategory list.
     * @param page
     *            Page number.
     * @param size
     *            Size of page.
     * @return The list of <strong>size</strong> found products in the page
     *         <strong>page</strong>.
     */
    List<Product> findBySubcategoryIn(List<String> subcategories, int page,
	    int size);

    /**
     * Find a products list for search params.
     * 
     * @param text
     *            The text to find in product title.
     * @param subcategories
     *            The subcategory list.
     * @param city
     *            The city product.
     * @param locality
     *            The city product.
     * @param page
     *            Page number.
     * @param size
     *            Size of page.
     * @return The list of <strong>size</strong> found products in the page
     *         <strong>page</strong>.
     */
    List<Product> findForSearch(String text, String status, List<String> subcategories,
	    String city, String locality, Double latitude, Double longitude,
	    Integer distance, int page, int size);

    List<Product> findByLocation(Point point, Distance dist, int page, int size);

}
